﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Geometry
{
    public sealed class Point3D : Point2D
    {
        public double Z { get; set; }
        public override void Zero()
        {
            base.Zero();
        }
        public void Move(double dx, double dy, double dz)
        {
            base.Move(dx,dy);
            Z += dz;
        }
        public double DistanceFrom(double x, double y,double z)
        {
            double dx = X - x;
            double dy = Y - y;
            double dz = Z - z;
            return Math.Sqrt(dx * dx + dy * dy+dz*dz);
        }
        public double DistanceFrom(Point3D p)
        {
            return DistanceFrom(p.X, p.Y,p.Z);
        }
        public override string ToString()
        {
            return string.Format("{0},{1},{2}", X,Y,Z);
        }
    }
}
